package chapter4.No4_1_使用reentrantLock类.demo12;

/**
 * getQueueLength()：得到等待获取锁的线程
 * Created by Administrator on 2016/11/21.
 */
public class Main2 {
    public static void main(String[] args) throws InterruptedException {
        ServiceClass2 sc = new ServiceClass2();

        for(int i = 0; i < 10; i++) {
            ThreadSC2 a = new ThreadSC2(sc);
            a.start();
        }

        Thread.sleep(2000);
        System.out.println("getQueueLength()="+sc.lock.getQueueLength());
    }
}
